package com.jzit168.library_base.baseVM

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.jzit168.library_base.base.BaseActivity

/**
 *@Desc: 携带创建ViewModel的Activity
 *@Author: Android Developer
 *@Date: 2020/10/14
 *
 **/
abstract class BaseVMActivity<VM : ViewModel> : BaseActivity() {

    open val viewModel: VM by lazy { ViewModelProvider(this)[getViewModel()] }

    abstract fun getViewModel(): Class<VM>

}